//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;
import java.util.stream.Collectors;

public class ChangeResultBO implements PickableBean {
    public static final String FN_GOODSID = "goodsId";
    public static final String FN_LISTS = "lists";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"goodsId", "lists"});
    private String goodsId;
    private List<String> lists;

    public ChangeResultBO(String goodsId, List<String> lists) {
        this.setGoodsId(goodsId);
        this.setLists(lists);
    }

    public ChangeResultBO() {
    }

    public ChangeResultBO duplicate() {
        ChangeResultBO result = new ChangeResultBO();
        result.goodsId = this.goodsId;
        result.lists = this.lists == null ? null : (List)this.lists.stream().map((e4) -> {
            return e4;
        }).collect(Collectors.toList());
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getGoodsId() {
        return this.goodsId;
    }

    public void setGoodsId(String value) {
        this.goodsId = value;
    }

    public ChangeResultBO withGoodsId(String value) {
        this.setGoodsId(value);
        return this;
    }

    public ChangeResultBO withGoodsId(String value, String defaultValue) {
        this.setGoodsId(value == null ? defaultValue : value);
        return this;
    }

    public List<String> getLists() {
        if (this.lists == null) {
            this.lists = Lists.newArrayList();
        }

        return this.lists;
    }

    public void setLists(List<String> value) {
        this.lists = value;
    }

    public ChangeResultBO withLists(List<String> value) {
        this.setLists(value);
        return this;
    }

    public ChangeResultBO withLists(List<String> value, List<String> defaultValue) {
        this.setLists(value == null ? defaultValue : value);
        return this;
    }

    public ChangeResultBO addLists(String value) {
        if (this.lists == null) {
            this.lists = Lists.newArrayList();
        }

        this.lists.add(value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case 102982549:
                if (name.equals("lists")) {
                    var3 = 1;
                }
                break;
            case 207037201:
                if (name.equals("goodsId")) {
                    var3 = 0;
                }
        }

        switch(var3) {
            case 0:
                return this.getGoodsId();
            case 1:
                return this.getLists();
            default:
                return null;
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof ChangeResultBO) ? false : this.signature().equals(((ChangeResultBO)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean ChangeResultBO has no signature defined, no hash code or equals possible.");
    }
}
